<template>
  <div class="report-form-content">
    <el-tabs type="border-card">
      <el-tab-pane label="合同请款">
        <div class="report-list"  v-if="obj">
          <label>请款金额：</label>
          <span>{{ obj.cashAmount }}</span>
        </div>
        <div class="report-list"  v-if="obj">
          <label>请款状态：</label>
          <span><EnumTag :enum-list="getEnumList('ContractInitialCashState')" :enum-key="obj.state" /></span>
        </div>
        <div class="report-list" v-if="obj">
          <label>请款类型：</label>
          <span><DictTag :dict-list="getDictList('ContractInitialCashType')" :dict-key="obj.cashType" /></span>
        </div>
      </el-tab-pane>
      <el-tab-pane label="合同详情">
        <contractMainDetail v-if="obj" :contractInitialId="obj.contractInitialId" />
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script setup>
import {ref, watch} from 'vue'
import {doGet} from "@/config/http";
import {svc} from "@/config/common";
import contractMainDetail from '@/views/components/contract/contractMainDetail.vue'

const props = defineProps({
  contractCashId: {
    required: true,
    type: String,
  }
})

let obj = ref(null)

const initObj = async (val) =>  {
  if (val) {
    obj.value = await doGet(svc, `/contract-initial-cash/${val}`, {}, true) 
  }
}

watch(() => props.contractCashId, async val => {
  await initObj(val)
  // await initList()
},{immediate:true})

</script>

<style scoped lang="scss">.report-form-content {
  padding: 20px;
}
.tabs-list-head-2 {
  padding-left: 0 !important;
}
.tabs-list-head-2 span {
  font-size: 22px !important;
  color: #1ac4ad !important;
}
.tabs-list-head {
  padding-left: 20px;
  display: flex;
  align-items: center;
}
.tabs-list-head span {
  font-size: 18px;
  color: #303133;
  font-weight: bold;
}
.tabs-list-head-1 {
  margin-bottom: 30px;
}
.tabs-list-type {
  display: flex;
  align-items: center;
  justify-content: center;
}
.update-log {
  width: 100%;
  margin: 30px 0;
}
.update-log-1 {
  margin-top: 0;
}
.report-list {
  /* width: 100%; */
  width: 33%;
  margin: 15px;
  display: flex;
  align-items: center;
  /* justify-content: space-between; */
}
.report-list-a {

}
.report-list-a p {
  margin-left: 55px;
}
.report-list span:nth-child(1) {
  display: inline-block;
  width: 120px;
  text-align: right;
}
.steps {
  margin: 20px 0
}
</style>
